home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / sharew / spiele / denker / gnuchess.gem / src / popupch.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-15  |  1.4 KB  |  65 lines

  1. #ifndef popupch_h
  2. #define popupch_h
  3.  
  4.  
  5. #include <gemhf.h>
  6. #include <gemsl.h>
  7.  
  8. // GCC 2.5.3 is having GREAT troubles with private inheritance!
  9. #define NOTpublic public
  10.  
  11. class PopupList : NOTpublic GEMhotform, NOTpublic GEMslider {
  12. public:
  13.     PopupList(GEMrsc&,
  14.         int RSCform,
  15.         int RSCchoice1,
  16.         int RSCchoicen,
  17.         int RSCscrollbar);
  18.  
  19.     int Choose(int x, int y, class PopupChoice* tell);
  20.     int DoHot(int ob, bool inside);
  21.  
  22. private:
  23.     virtual void VFlush();
  24.     PopupChoice* tell; // actually, static would do.
  25.     int choice1,choicen,scrollbar;
  26. };
  27.  
  28. class PopupChoice : NOTpublic GEMobject {
  29. public:
  30.     PopupChoice(GEMform&, int RSCindex, PopupList& popup);
  31.  
  32.     int Choice() { return lastchosen; }
  33.     virtual void ChoiceChanged(); // Default = do nothing (ie. poll Choice())
  34.  
  35.     virtual void InitObject(GEMrawobject& object); // Sizes to size of this.
  36.     virtual void SelectObject(int choice, bool yes, GEMrawobject& object); // SELECT
  37.     virtual void SetObject(int choice, GEMrawobject& object)=0;
  38.     virtual int NumberOfChoices() const=0;
  39.  
  40. protected:
  41.     virtual GEMfeedback Touch(int x, int y, const GEMevent& e);
  42.     void Choose(int);
  43.  
  44. private:
  45.     PopupList& popup;
  46.     int lastchosen;
  47. };
  48.  
  49.  
  50. class ArrowablePopupChoice : NOTpublic PopupChoice {
  51. public:
  52.     ArrowablePopupChoice(GEMform&, int RSCindex, PopupList& popup);
  53.     ~ArrowablePopupChoice();
  54.  
  55.     void UpList();
  56.     void DownList();
  57.  
  58. protected:
  59.     GEMobject* upper;
  60.     GEMobject* downer;
  61. };
  62.  
  63.  
  64. #endif
  65.